package Demo;

import javax.swing.*;
import java.awt.*;

public class Demo94 {
    public static void main(String[] args) {
        JDialog jf=new JDialog();
        jf.setBackground(Color.WHITE);
        jf.setBounds(200,200,500,500);
        jf.setResizable(true);
        Container con = jf.getContentPane();
        JTextField jt=new JTextField (10);
        con.setLayout (new FlowLayout ());
        JPanel jp=new JPanel();
        JButton btn=new JButton("touch");
        btn.addActionListener((event)->{
            Color color=JColorChooser.showDialog(jp,"choose color",Color.WHITE);
            jf.setBackground(color);
            jp.setBackground(new Color(200,200,200,0));
            JLabel jl=new JLabel();
        });

        con.add (jt);
        jp.add(btn);
        con.add(jp);
        jf.setVisible(true);
    }
}
